package homework.test02;
/*
 *javabean类,合理隐藏,合理暴露
 *
 * */


public class Student {
    //1.成员变量
    private String name;
    private int age;

    //2.无参和有参构造

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //3.对外暴露,操作存和取数据的方法

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
